package com.rykj.energy.common.enums;

public enum StateType {

    NORMAL("normal","正常"),
    DELETED("deleted","删除状态"),
    WARN("warn","异常"),
    HIGH("high","高限"),
    LOW("low","低限"),
    OFFLINE("offline","离线"),
    UNDEAL("unDeal","未处理"),
    DEAL("deal","已处理");

    public String code;
    public String name;

    StateType(String code, String name){
        this.code = code;
        this.name = name;
    }

    public static StateType parse(String code){
        for(StateType type : values()){
            if(type.getCode() == code){
                return type;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

}
